package com.lethelh.jdbc.app;

import com.lethelh.jdbc.app.command.*;

import java.util.Scanner;

public class GoodsApplication {
    public static void main(String[] args) {
        System.out.println("---------1.查询商品---------");
        System.out.println("---------2.新增商品---------");
        System.out.println("---------3.更新商品---------");
        System.out.println("---------4.删除商品---------");
        System.out.println("-----请输入序号操作商品信息-----");
        Scanner input = new Scanner(System.in);
        int index = input.nextInt();
        Command command = null;
        switch (index){
            case 1:
                command = new QueryCommand();
                command.execute();
                break;
            case 2:
                command = new InsertCommand();
                command.execute();
                break;
            case 3:
                command = new UpdateCommand();
                command.execute();
                break;
            case 4:
                command = new DeleteCommand();
                command.execute();
                break;
        }
    }
}
